<template>
	<div class="list allSearch">
		<div class="searchBox">
			<div class="btnBox">
				<el-button type="primary" size="mini" @click="search">搜索</el-button>
				<el-button type="primary" plain size="mini" @click="clearSearch">重置</el-button>
			</div>
			<div class="searchCon" :class="open_show?'hA':'h210'">
				<div class='field_item' v-for='(field,index) in fields' :key="index"
					v-if="field.header_search&&String(field.header_search)!='{}'&&((field.header_search.isHide&&!field.header_search.isHide(self))||!field.header_search.isHide)">
					<component :field="field"
						:optionData="field.header_search.optionsName?optionData[field.header_search.optionsName]:''"
						:defaultValue="field.header_search.defaultValue||field.header_search.defaultValue==0?field.header_search.defaultValue:''"
						:is="field.header_search.componentName"
						:fieldArguments="field.header_search?field.header_search:{}"
						@onChange="header_search_fieldChange">
					</component>
				</div>
			</div>
			<div class="open">
				<el-button type="primary" size="mini" @click="openShow">展开
					<i class="el-icon-arrow-up" v-if="open_show"></i>
					<i class="el-icon-arrow-down" v-else></i>
				</el-button>
			</div>
		</div>


		<div class="tableCon">

			<solely-table ref='solely-table' @onClickBtn="onClickBtn" @pageChange="pageChange"
				@filtersChange="filtersChange" @onSelectionChange="onSelectionChange" @initMainData="initMainData"
				:mainData='mainData' :Pagination="paginate" :BtnInfo="btn_info" :FieldList='fields'
				:optionData='optionData' :otherData='otherData' :BasicArguments="table_arguments">
				<template v-slot:mainImg="mainImg">
					<img style="width: 30px;float: left;" v-for="(item,index) in mainImg.data.mainImg" :key="index"
						:src="item['url']" />
				</template>
				<template v-slot:expand="expand">
					<div v-if="expand.data.behavior==2">
						<div style="padding: 5px;">账户：{{expand.data.keywords}}</div>
						<div style="padding: 5px;">真实姓名：{{expand.data.name}}</div>
						<div style="padding: 5px;">收款码：
							<el-image v-for="(item,index) in expand.data.mainImg" :key="index"
							    style="width: 100px; height: 100px;"
							    :src="item['url']" 
							    :preview-src-list="[item.url]">
							</el-image>
						</div>
					</div>
					<div v-else>
						<div>到账微信：{{expand.data.user&&expand.data.user.nickname}}</div>
					</div>
				</template>
			</solely-table>
		</div>

		<el-dialog :title="btnNow.text&&btnNow.text(originFormData)?btnNow.text(originFormData):''"
			:visible.sync="dialog.dialogFormVisible" :close-on-click-modal='false'>
			<div style="overflow:hidden;zoom:1;text-align: left;padding: 2%;">

				<template v-for='(field,index) in fields'>
					<div v-if="btnName&&field.application&& field.application.indexOf(btnName)>-1" :key="index"
						style="float: left;margin-right: 2%;margin-bottom:5%;padding-left: 1%;"
						:style="field.dialogStyle?field.dialogStyle:'width:47%'" :label-width="formLabelWidth">
						<div style="display: inline-block;width: 100px;text-align: left;font-weight: bold;">
							<span style="color:red">{{field.checkKey?'*':''}}</span>{{field.label}}：</div>
						<div style="display: inline-block;min-width: 225px;min-height: 50px;">
							<component :field="field" :optionData="optionData[field.optionsName]"
								:defaultValue="formData[field.key]||formData[field.key]==0?formData[field.key]:''"
								:is="field.componentName || 'sls-input'" :fieldArguments="field.dialog?field.dialog:{}"
								@onChange="dialog_fieldChange">
							</component>
						</div>
					</div>
				</template>

			</div>
			<div slot="footer" class="dialog-footer" style="text-align: center;">
				<el-button @click="dialog.dialogFormVisible = false">取 消</el-button>
				<el-button type="primary" @click="submit">确 定</el-button>
			</div>
		</el-dialog>
	</div>
</template>


<script>
	import withdrawJs from './withdraw.js'
	export default withdrawJs
</script>
<style>



</style>
